import React, { useContext } from 'react';
import { Form, Input } from 'antd';

import BannerAttr from '../DragZt/Banner/attribute';
import TitleAttr from '../DragZt/Title/Attribute';
import TableAttr from '../DragZt/Table/Attribute';

import { DesignRedux } from '../DesignRedux';

const RightForm = (props: any) => {
  const [form] = Form.useForm();

  // 在使用useContext解构出color中想要传递的值，就是最终返回给我们的值
  const { globalState } = useContext(DesignRedux);
  const { rightNode } = globalState; // 右侧元素属性
  if (rightNode.comName == 'ztBanner') {
    return <BannerAttr />;
  }

  if (rightNode.comName == 'ztTitle') {
    return <TitleAttr />;
  }

  if (rightNode.comName == 'ztTable') {
    return <TableAttr />;
  }

  return null;
};

export default RightForm;
